<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图片预览-案例</title>
    <link rel="stylesheet" href="../dist/style.css">
    <style>
        .page{
            padding: 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .small-img{
            width: 60px;
            height: 60px;
        }
    </style>
</head>
<body>
    <div class="page">
        <img src="https://img.horion.com/mall/goods/51269-1.jpg" alt="" class="small-img" draggable="false" preview>
        <p>点击预览</p>
        <img src="https://img.horion.com/mall/goods/33508-素材.jpg" alt="" class="small-img" draggable="false" preview>
        <p>点击预览</p>
        <img src="https://img.horion.com/mall/goods/4776-section5-1312.png" alt="" class="small-img" draggable="false" preview>
        <p>点击预览</p>
        <button id="previewBtn">预览图片</button>
    </div>
    <script src="../dist/index.umd.js"></script>
    <script>
        imagePreviewer.initConfig();
        document.querySelector('#previewBtn').addEventListener('click', function(){
            imagePreviewer.previewImage('https://img.horion.com/mall/goods/51269-1.jpg');
        });
    </script>
</body>
</html>